package com.test.cordova.util;

import android.util.Log;

/**
 * applog管理工具类
 */
public class Logger {

	private static  int LEVEL = 0;
	private static final int LEVEL_I = 1;
	private static final int LEVEL_V = 2;
	private static final int LEVEL_D = 3;
	private static final int LEVEL_E = 4;
	private static final int LEVEL_W = 5;

	public static void setDebugMode(boolean isDebug){
		if (!isDebug) {
			LEVEL = 6;
		}
	}

	public static void i(String TAG, String content) {
		if (LEVEL_I > LEVEL) {
			Log.i(TAG, content == null ? "未知日志" : content);
		}
	}

	public static void v(String TAG, String content) {
		if (LEVEL_V > LEVEL) {
			Log.v(TAG, content == null ? "未知日志" : content);
		}
	}

	public static void d(String TAG, String content) {
		if (LEVEL_D > LEVEL) {
			Log.d(TAG, content == null ? "未知日志" : content);
		}
	}

	public static void e(String TAG, String content) {
		if (LEVEL_E > LEVEL) {
			Log.e(TAG, content == null ? "未知日志" : content);
		}
	}

	public static void w(String TAG, String content) {
		if (LEVEL_W > LEVEL) {
			Log.w(TAG, content == null ? "未知日志" : content);
		}
	}

}
